home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Modem / SCR info / scr-cisco-script.txt < prev    next >
Text File  |  1994-07-05  |  2KB  |  103 lines

  1. !
  2. ! InterSLIP gateway script for Cisco terminal server
  3. !
  4. ! Label 99 is the general purpose error handler, which beeps
  5. ! and pauses long enough for the user to read the message.
  6. !
  7. ! First, we wait for the user name prompt
  8. !
  9. @originate
  10. note "Waiting for prompt"
  11. matchclr
  12. matchstr 1 1 "Username: "
  13. matchread 50
  14. note "No username prompt"
  15. jump 99
  16. !
  17. ! Now, send the user name and wait for the password prompt
  18. !
  19. @label 1
  20. note "Sending user name"
  21. write "^5\13"
  22. matchclr
  23. matchstr 1 2 "Password:"
  24. matchread 50
  25. note "No password prompt"
  26. jump 99
  27. !
  28. ! Send the password and wait for either the terminal server
  29. ! prompt or an error message
  30. !
  31. @label 2
  32. note "Sending password"
  33. write "^6\13"
  34. matchclr
  35. matchstr 1 4 ">"
  36. matchstr 2 3 "Access denied"
  37. matchread 120
  38. jump 99
  39. !
  40. ! If we got an error message, notify the user and fail
  41. !
  42. @label 3
  43. note "Access Denied"
  44. !
  45. ! General purpose error handler.  Let the message appear,
  46. ! beep, and then pause for a second.
  47. !
  48. @label 99
  49. pause 1
  50. sound
  51. pause 60
  52. exit -1
  53. !
  54. ! If we've successfully logged in, ask for SLIP mode and
  55. ! wait for the response.  If we get anything except
  56. ! "Entering SLIP mode.", assume something went wrong, and fail.
  57. !
  58. @label 4
  59. note "Requesting SLIP"
  60. write "slip\13"
  61. matchclr
  62. matchstr 1 5 "Entering SLIP mode."
  63. matchread 120
  64. note "Cannot invoke SLIP mode"
  65. jump 99
  66. !
  67. ! We've entered SLIP mode, so match on the first thing that
  68. ! looks like an IP address.  If we don't find one, fail.
  69. !
  70. @label 5
  71. matchclr
  72. matchexp 1 6 "[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\."
  73. matchread 120
  74. note "No IP address given"
  75. jump 99
  76. !
  77. ! We've found an IP address, so inform MacTCP of it, and
  78. ! watch for a number (the MTU size).
  79. !
  80. @label 6
  81. setip "^0"
  82. note "IP address is:  ^0"
  83. pause 300
  84. matchclr
  85. matchexp 1 7 "[0-9][0-9]*"
  86. matchread 120
  87. note "No MTU value"
  88. jump 99
  89. !
  90. ! We found the MTU size, so inform MacTCP and exit
  91. ! the script successfully.
  92. !
  93. @label 7
  94. setmtu "^0"
  95. exit 0
  96. !
  97. ! Answer and Hangup modes are currently unused in gateway
  98. ! scripts, but just for future compatibility, exit successfully.
  99. !
  100. @answer
  101. @hangup
  102. exit 0
  103.